<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 10404
  Date: 2021/11/8
  Time: 13:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍展示</title>
    <%--BootStrap--%>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">


</head>
<body>
    <div class="container">
        <div class="row clearfix">
            <div class="row-md-12 column">
                <div class="page-header">
                    <h1>
                        <small>书籍列表---------显示所有书籍</small>
                    </h1>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-4 column">
                <div class="page-header">
                    <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toAddPaper">新增书籍</a>
                    <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/all">显示全部书籍</a>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-8 column">
                <div class="page-header">
                    <form class="form-inline"  action="${pageContext.request.contextPath}/book/queryName" method="post" style="float: right">
                        <span style="color: red">${error}</span>
                        <input type="text" class="form-control" name="name" placeholder="请输入要查询的书名">
                        <input type="submit" class="btn btn-primary" value="查询">
                    </form>-
                </div>
            </div>
        </div>

        <div class="row clearfix">
            <div class="col-md-12 column">
                <table class="table table-hover table-striped">
                    <thead>
                        <tr>
                            <th>书籍编号</th>
                            <th>书籍名称</th>
                            <th>书籍数量</th>
                            <th>书籍详情</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <%--书籍从数据库中查询出来，存放在booklist--%>
                    <tbody>
                        <c:forEach var="books" items="${list}">
                          <tr>
                              <td>${books.bookID}</td>
                              <td>${books.bookName}</td>
                              <td>${books.bookCounts}</td>
                              <td>${books.detail}</td>
                              <td>
                                  <a href="${pageContext.request.contextPath}/book/toUpdatePaper/${books.bookID}">修改</a>&nbsp;
                                    &nbsp; | &nbsp;
                                  <a href="${pageContext.request.contextPath}/book/delete/${books.bookID}">删除</a>
                              </td>
                          </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</body>
</html>